<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAgentAccountsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent_accounts', function (Blueprint $table) {
            $table->increments('id');
            $table->bigInteger('agent_id');
            $table->decimal('balance')->default('0.00')->comment('余额');
            $table->decimal('profits')->default('0.00')->comment('总收益');
            $table->decimal('withdrawed')->default('0.00')->comment('已提现');
            $table->string('bank_receiver')->nullable()->comment('银行卡收款人');
            $table->string('bank_name')->nullable()->comment('银行名称');
            $table->string('bank_number')->nullable()->comment('银行卡号');
            $table->string('ali_account')->nullable()->comment('支付宝账号');
            $table->string('ali_qr')->nullable()->comment('支付宝收款码');
            $table->string('wx_receiver')->nullable()->comment('微信收款人');
            $table->string('wx_qr')->nullable()->comment('微信收款码');
            $table->string('edit_code',6)->nullable()->comment('修改码');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agent_accounts');
    }
}
